﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JXT.PrimaryKey.Batman.Domain.Models;

namespace JXT.PrimaryKey.Batman.Domain.UserSystem.Models
{
    [Serializable]
    public class User : EntityBase<int>
    {
        public string Name { get; set; }

        public string Mail { get; set; }

        public string Password { get; set; }

        public UserDetail Detail { get; set; }

        public UserStatus Status { get; set; }

        [NonSerialized]
        private IEnumerable<Role> _roles;

        public IEnumerable<Role> Roles
        {
            get { return _roles; }
            set { _roles = value; }
        }

        private List<Authority> _authorities;

        public IEnumerable<Authority> Authorities
        {
            get { return _authorities; }
            set { _authorities = value == null ? null : value.ToList(); }
        }

        public LoginStatus loginStatus { get; set; }
    }
}
